$(document).ready(function(){
    $("#add").click(function() {
        window.location.href="/User/Add";
    });
});

function deleteUserClick(id) {
    var re = confirm("Do you confirm to delete this user ?")
    if (re == true) {
        form = {
            'id': id
        }
        $.ajax({
            url: "/user/deleteAjax",
            async: false,
            type: "post",
            data: form,
            success: function (data) {
                // alert(JSON.stringify(data));
                // var result = JSON.parse(data);
                if (data.resultCode == "SUCCESS") {
                    window.location.href=data.data
                } else {
                    alert("Delete Failed ["+data.resultMsg+"]");
                }
            }
        })
    }
}

function editUserClick(id) {
    window.location.href = "/user/edit/" + id;
}